﻿@inherits BasePlugin

<PluginForm Model="@UpdateModel" Name="@FORM_NAME" Title="Update User" OnSubmit="OnUserUpdate">
    <FormHiddenInput @bind-Value="UpdateModel!.Id" />
    <FormInput @bind-Value="Username" Cols="6" Disabled Label="Username" Placeholder="Enter Username" Required />
    <FormInput @bind-Value="UpdateModel!.Email" Cols="6" Label="Email" Placeholder="Enter Email" Required />
    <FormInput @bind-Value="UpdateModel!.FirstName" Cols="6" Label="First Name" Placeholder="Enter First Name" />
    <FormInput @bind-Value="UpdateModel!.LastName" Cols="6" Label="Last Name" Placeholder="Enter Last Name" />
    <FormInput @bind-Value="UpdateModel!.PhoneNumber" Cols="6" Label="Phone Number" Placeholder="Enter Phone Number" />
    <FormCheckbox @bind-Value="UpdateModel!.Enabled" Cols="6" Label="Enabled" Text="Enable/disable user account" />
    <FormActions Cancel Submit />
</PluginForm>

<PluginForm Model="@UserRolesModel" Name="@FORM_NAME_ASSIGN_ROLE" OnSubmit="OnRoleUpdate">
    <FormHiddenInput @bind-Value="UserRolesModel!.UserId" />
    <FormHiddenInput @bind-Value="UserRolesModel!.SiteId" />
    <FormCheckboxGroup @bind-Value="UserRolesModel!.RoleIds" Data="ViewState.Site.AllRoles.Where(x=> x.Type == RoleTypesViewState.UserDefined || x.Type == RoleTypesViewState.Administrators).ToList()" Label="Roles" TextField="Name" ValueField="Id" />
    <FormActions Cancel Submit />
</PluginForm>

<PluginForm Model="@SetPasswordModel" Name="@FORM_NAME_PASSWORD" Title="Set New Password" OnSubmit="OnChangePassword">
    <FormHiddenInput @bind-Value="SetPasswordModel!.UserId" />
    <FormInput @bind-Value="SetPasswordModel!.Password" Cols="6" Label="New Password" Placeholder="Enter Password" Required type="password" />
    <FormActions Cancel Submit />
</PluginForm>
